Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds 'buildable' selection mode #6366

Merged
merged 1 commit into from
Jan 10, 2023
Merged

Adds 'buildable' selection mode #6366

merged 1 commit into from
Jan 10, 2023

Conversation

AGPapa
Copy link
Contributor

@AGPapa AGPapa commented Dec 2, 2022

resolves #6365

Description

This PR adds a new selection mode called 'buildable'. This selection mode runs tests if the test's parents are selected - or if the tests's parents are ancestors of what is selected. This change makes it easier to develop part of the graph and test changes on it. See the issue for a more detailed description.

I am able to make changes to this PR in response to feedback! As mentioned in the issue, I think that some or all of these changes could be made directly to the existing cautious mode, without making a new selection mode at all.

Checklist

@AGPapa AGPapa requested a review from a team December 2, 2022 16:03
@AGPapa AGPapa requested a review from a team as a code owner December 2, 2022 16:03
@cla-bot cla-bot bot added the cla:yes label Dec 2, 2022
@AGPapa AGPapa closed this Dec 6, 2022
@AGPapa AGPapa reopened this Dec 6, 2022
@dbeatty10 dbeatty10 added the ready_for_review Externally contributed PR has functional approval, ready for code review from Core engineering label Dec 10, 2022
@@ -173,12 +174,14 @@ class BaseSelectionGroup(dbtClassMixin, Iterable[SelectionSpec], metaclass=ABCMe
def __init__(
self,
components: Iterable[SelectionSpec],
indirect_selection: IndirectSelection = IndirectSelection.Eager,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case this is confusing - in selector.py on line 138 we need to get the indirect selection method from a composite spec (a union, difference, or intersection). This change here, and the changes in cli.py, add the indirect selection method to these composite specs through the BaseSelectionGroup so we can get them at that line in selector.py. Previously the indirect selection method was only on the SelectionCriteria object.

It's possible I misunderstood how something works here, but I couldn't find an easier way to get the indirect selection method at that point.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this note, really helpful!

@AGPapa AGPapa closed this Dec 13, 2022
@AGPapa AGPapa reopened this Dec 13, 2022
@AGPapa AGPapa changed the title Adds semicautious selection to dbt Adds 'buildable' selection mode Dec 13, 2022
@dbeatty10
Copy link
Contributor

@AGPapa
One thing you can do to get ready for review is to run changie new to enter the details for the changelog entry. Running changie will require installing the development dependencies in your local environment. The changelog describes the specific details for this step.

Excited about the work you've done on this! 🤩

Copy link
Contributor

@ChenyuLInx ChenyuLInx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @AGPapa for adding this new selection method!

@@ -173,12 +174,14 @@ class BaseSelectionGroup(dbtClassMixin, Iterable[SelectionSpec], metaclass=ABCMe
def __init__(
self,
components: Iterable[SelectionSpec],
indirect_selection: IndirectSelection = IndirectSelection.Eager,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this note, really helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes cli ready_for_review Externally contributed PR has functional approval, ready for code review from Core engineering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-1590] [Feature] Improving dbt selection options
4 participants